#ifndef _SIM_LQI_H_
#define _SIM_LQI_H_

typedef struct lqi_dist {
  uint8_t lqi;
  double cdf;
} lqi_dist_t;

typedef struct snr_lqi {
  double snr;
  uint8_t numLqi;
  lqi_dist_t *lqi;
} snr_lqi_t;

lqi_dist_t snr24[] = {{108, 49.5481927711}, {102, 49.9397590361}, {103, 50.9036144578}, {101, 51.0542168675}, {106, 63.7951807229}, {107, 92.3192771084}, {104, 94.2168674699}, {105, 100.0}};
lqi_dist_t snr25[] = {{98, 0.0320204931156}, {108, 48.9593339737}, {102, 49.1514569324}, {103, 49.8879282741}, {100, 49.9199487672}, {101, 49.9839897534}, {106, 64.3932116555}, {107, 93.5638808838}, {104, 95.58117195}, {105, 100.0}};
lqi_dist_t snr26[] = {{108, 49.9569583931}, {102, 50.3586800574}, {103, 51.1047345768}, {101, 51.1334289813}, {106, 63.6441893831}, {107, 93.68723099}, {104, 95.4662840746}, {105, 100.0}};
lqi_dist_t snr27[] = {{108, 51.0854243022}, {102, 51.2545813363}, {103, 51.7056667606}, {100, 51.7338595997}, {101, 51.7620524387}, {106, 64.223287285}, {107, 94.051310967}, {104, 96.1093882154}, {105, 100.0}};
lqi_dist_t snr20[] = {{99, 0.0332667997339}, {108, 37.9906852961}, {102, 38.5562208916}, {103, 40.0864936793}, {100, 40.119760479}, {101, 40.252827678}, {106, 56.3872255489}, {107, 89.5542248836}, {104, 92.7811044578}, {105, 100.0}};
lqi_dist_t snr21[] = {{108, 40.3826787513}, {102, 40.953340047}, {103, 41.9268210809}, {100, 42.061094327}, {101, 42.2289358845}, {106, 58.4424303458}, {107, 89.7616649883}, {104, 92.2457200403}, {105, 100.0}};
lqi_dist_t snr22[] = {{108, 44.0018966335}, {102, 44.4760550024}, {103, 45.4243717402}, {100, 45.4717875771}, {101, 45.6377430062}, {106, 60.6685633001}, {107, 90.9198672357}, {104, 93.6699857752}, {105, 100.0}};
lqi_dist_t snr23[] = {{108, 46.3674104826}, {102, 46.8085106383}, {103, 47.6647638817}, {100, 47.7166580176}, {101, 47.8204462896}, {106, 61.6761805916}, {107, 91.64504411}, {104, 93.8764919564}, {105, 100.0}};
lqi_dist_t snr28[] = {{108, 51.1636636637}, {102, 51.4264264264}, {103, 51.9144144144}, {100, 52.027027027}, {106, 64.3393393393}, {107, 94.3318318318}, {104, 96.2837837838}, {105, 100.0}};
lqi_dist_t snr29[] = {{108, 53.434225844}, {102, 53.7834691502}, {103, 54.4819557625}, {101, 54.5401629802}, {106, 65.9487776484}, {107, 94.3538998836}, {104, 95.983701979}, {105, 100.0}};
lqi_dist_t snr0[] = {{82, 7.20720720721}, {63, 8.10810810811}, {64, 10.8108108108}, {66, 12.6126126126}, {69, 16.2162162162}, {68, 19.8198198198}, {83, 24.3243243243}, {80, 28.8288288288}, {81, 34.2342342342}, {86, 36.9369369369}, {87, 37.8378378378}, {84, 40.5405405405}, {85, 42.3423423423}, {77, 50.4504504505}, {76, 60.3603603604}, {75, 65.7657657658}, {74, 72.0720720721}, {73, 74.7747747748}, {72, 78.3783783784}, {71, 81.0810810811}, {70, 81.981981982}, {92, 82.8828828829}, {79, 90.990990991}, {78, 99.0990990991}, {52, 100.0}};
lqi_dist_t snr3[] = {{62, 0.0711743772242}, {67, 0.391459074733}, {60, 0.462633451957}, {102, 0.569395017794}, {88, 5.62277580071}, {89, 10.3558718861}, {64, 10.5693950178}, {65, 10.7473309609}, {66, 10.9964412811}, {69, 11.5658362989}, {82, 17.0818505338}, {83, 22.8825622776}, {80, 27.7224199288}, {81, 32.4555160142}, {86, 37.9003558719}, {87, 42.9893238434}, {84, 47.9359430605}, {85, 53.4163701068}, {92, 56.6903914591}, {79, 60.7117437722}, {104, 60.7473309609}, {78, 64.9822064057}, {68, 65.6583629893}, {99, 66.4412811388}, {98, 67.0462633452}, {75, 70.0}, {74, 71.6370106762}, {73, 73.5231316726}, {72, 75.0177935943}, {71, 76.2989323843}, {70, 76.975088968}, {91, 80.462633452}, {90, 84.2348754448}, {100, 84.590747331}, {101, 84.6619217082}, {95, 86.1209964413}, {94, 88.3629893238}, {97, 89.3950177936}, {96, 90.8540925267}, {77, 94.590747331}, {59, 94.6263345196}, {76, 97.3309608541}, {61, 97.4021352313}, {93, 99.8932384342}, {63, 100.0}};
lqi_dist_t snr2[] = {{67, 1.42984807864}, {60, 1.51921358356}, {68, 2.32350312779}, {88, 4.7363717605}, {89, 7.14924039321}, {64, 7.86416443253}, {65, 8.57908847185}, {66, 9.29401251117}, {69, 12.0643431635}, {82, 18.1411974978}, {83, 24.3967828418}, {80, 29.2225201072}, {81, 33.8695263628}, {93, 34.763181412}, {87, 38.1590705987}, {84, 43.4316353887}, {85, 48.436103664}, {86, 51.8319928508}, {97, 51.9213583557}, {96, 52.2788203753}, {77, 58.3556747096}, {76, 64.164432529}, {75, 67.7390527256}, {74, 72.3860589812}, {73, 75.6032171582}, {72, 78.4629133155}, {71, 81.8588025022}, {70, 83.6461126005}, {91, 84.8078641644}, {90, 86.6845397676}, {100, 86.7739052726}, {92, 88.2037533512}, {95, 88.5612153709}, {94, 88.7399463807}, {79, 93.3869526363}, {78, 98.927613941}, {59, 99.0169794459}, {98, 99.1063449508}, {56, 99.1957104558}, {61, 99.4638069705}, {62, 99.7319034853}, {63, 100.0}};
lqi_dist_t snr5[] = {{67, 0.153468385513}, {102, 1.01289134438}, {88, 6.1387354205}, {89, 11.6942909761}, {64, 11.9091467158}, {65, 11.9398403929}, {66, 11.97053407}, {103, 12.5230202578}, {100, 14.4260282382}, {83, 18.3241252302}, {80, 20.9023941068}, {81, 23.6955187231}, {86, 28.2688766114}, {87, 32.9957028852}, {84, 36.4333947207}, {85, 40.730509515}, {101, 41.9582565991}, {63, 42.0196439533}, {79, 44.1375076734}, {106, 44.1682013505}, {82, 47.0841006753}, {104, 47.3910374463}, {96, 51.6574585635}, {68, 51.9950890117}, {78, 53.8060159607}, {99, 56.0773480663}, {98, 59.4536525476}, {75, 60.8041743401}, {74, 61.4487415592}, {73, 61.97053407}, {72, 62.6764886433}, {71, 63.2903621854}, {70, 63.5972989564}, {91, 68.9993861265}, {90, 74.6777163904}, {93, 79.8956414979}, {92, 85.8809085328}, {95, 90.0859422959}, {94, 94.2909760589}, {97, 97.6672805402}, {105, 97.7593615715}, {77, 98.9257213014}, {76, 99.7851442603}, {56, 99.8158379374}, {61, 99.8465316145}, {69, 100.0}};
lqi_dist_t snr7[] = {{67, 0.0192012288786}, {102, 5.04992319508}, {88, 8.25652841782}, {89, 12.1927803379}, {64, 12.2119815668}, {65, 12.2311827957}, {66, 12.2503840246}, {103, 16.9162826421}, {100, 22.1966205837}, {83, 24.3855606759}, {80, 25.5184331797}, {81, 27.1505376344}, {86, 30.222734255}, {87, 33.2373271889}, {84, 35.4070660522}, {85, 37.6920122888}, {101, 43.1643625192}, {63, 43.1835637481}, {79, 44.2396313364}, {106, 44.8732718894}, {82, 46.1789554531}, {107, 46.2749615975}, {104, 49.5007680492}, {105, 51.3248847926}, {78, 52.380952381}, {99, 57.2196620584}, {98, 62.1543778802}, {75, 62.5}, {74, 62.7112135177}, {73, 62.9992319508}, {72, 63.2680491551}, {71, 63.3448540707}, {70, 63.4792626728}, {91, 67.7995391705}, {90, 72.1006144393}, {93, 76.3056835637}, {92, 80.2995391705}, {95, 84.8502304147}, {94, 89.1321044547}, {97, 93.9132104455}, {96, 98.732718894}, {77, 99.366359447}, {59, 99.3855606759}, {76, 99.9615975422}, {69, 100.0}};
lqi_dist_t snr6[] = {{67, 0.128238009746}, {102, 3.35983585535}, {88, 6.82226211849}, {89, 10.0538599641}, {64, 10.1820979738}, {65, 10.3103359836}, {66, 10.4642215953}, {103, 12.8238009746}, {82, 15.1064375481}, {83, 17.5173121313}, {80, 19.4152346756}, {81, 21.9286996666}, {86, 24.4934598615}, {93, 28.5714285714}, {84, 30.7771223391}, {85, 33.7778917671}, {101, 37.4967940498}, {79, 39.2151833804}, {95, 44.3959989741}, {87, 46.8325211593}, {104, 47.986663247}, {105, 48.473967684}, {68, 48.6535008977}, {78, 50.2436522185}, {99, 55.5270582201}, {98, 60.2462169787}, {75, 61.2977686586}, {74, 62.144139523}, {73, 62.9905103873}, {72, 63.8112336497}, {71, 64.2472428828}, {70, 64.4780713003}, {91, 68.0430879713}, {90, 71.5055142344}, {100, 76.6093870223}, {92, 80.3795845088}, {106, 80.4821749166}, {94, 85.4321620928}, {97, 91.5106437548}, {96, 96.9222877661}, {77, 98.2816106694}, {76, 99.6665811747}, {61, 99.7178763786}, {62, 99.7435239805}, {69, 100.0}};
lqi_dist_t snr8[] = {{102, 6.99633699634}, {88, 9.06593406593}, {89, 11.0073260073}, {103, 17.9304029304}, {82, 18.2783882784}, {83, 18.7912087912}, {80, 19.0476190476}, {81, 19.2857142857}, {86, 20.3663003663}, {87, 22.0146520147}, {84, 22.7106227106}, {85, 23.6813186813}, {101, 31.0805860806}, {79, 31.1721611722}, {106, 33.0769230769}, {107, 33.2967032967}, {104, 39.1941391941}, {105, 43.3882783883}, {78, 43.4615384615}, {100, 50.293040293}, {99, 57.2527472527}, {98, 64.0842490842}, {75, 64.1208791209}, {74, 64.1391941392}, {91, 67.3626373626}, {90, 70.4761904762}, {93, 74.4505494505}, {92, 77.9120879121}, {95, 83.4249084249}, {94, 88.3882783883}, {97, 94.1025641026}, {96, 99.8901098901}, {77, 99.9816849817}, {76, 100.0}};
lqi_dist_t snr11[] = {{91, 0.0598444045482}, {92, 0.179533213645}, {108, 0.239377618193}, {95, 0.957510472771}, {93, 1.25673249551}, {94, 1.7354877319}, {99, 6.40335128665}, {98, 8.73728306403}, {96, 9.99401555955}, {97, 11.6696588869}, {88, 11.7295032914}, {90, 11.7594254937}, {102, 24.7755834829}, {103, 40.9634949132}, {100, 47.0676241771}, {101, 55.5954518253}, {106, 65.4398563734}, {107, 67.9533213645}, {104, 84.5302214243}, {105, 100.0}};
lqi_dist_t snr10[] = {{102, 10.8441850022}, {88, 11.2258643916}, {89, 11.5401885945}, {103, 23.3497979344}, {100, 32.8244274809}, {83, 32.8693309385}, {86, 32.9591378536}, {87, 33.2734620566}, {84, 33.3857207005}, {85, 33.4979793444}, {101, 43.578805568}, {79, 43.6012572968}, {106, 47.4854063763}, {107, 48.1814099686}, {104, 57.7009429726}, {105, 65.626403233}, {99, 74.5172878312}, {98, 81.2079030085}, {91, 81.9712617872}, {90, 82.5774584643}, {93, 84.1041760216}, {92, 85.4737314773}, {95, 88.6394252357}, {94, 90.7498877414}, {97, 96.273013022}, {96, 100.0}};
lqi_dist_t snr13[] = {{96, 0.0612745098039}, {99, 0.816993464052}, {98, 1.14379084967}, {108, 2.51225490196}, {97, 2.61437908497}, {102, 7.96568627451}, {103, 16.5645424837}, {100, 17.7696078431}, {101, 20.1593137255}, {106, 45.5882352941}, {107, 63.8684640523}, {104, 78.8807189542}, {105, 100.0}};
lqi_dist_t snr12[] = {{108, 0.241911097672}, {95, 0.423344420925}, {93, 0.483822195343}, {94, 0.514061082552}, {99, 1.96552766858}, {98, 2.6912609616}, {96, 2.81221651043}, {97, 3.26579981857}, {102, 10.9767160568}, {103, 23.4351375869}, {100, 26.0659207741}, {101, 30.9948593892}, {106, 51.1944360448}, {107, 60.5080133051}, {104, 78.7420622921}, {105, 100.0}};
lqi_dist_t snr15[] = {{99, 0.064116264159}, {98, 0.085488352212}, {108, 6.79632400085}, {102, 8.20688181235}, {103, 11.8615088694}, {100, 12.2462064544}, {101, 12.9728574482}, {106, 39.0468048728}, {107, 75.1870057705}, {104, 83.1160504381}, {105, 100.0}};
lqi_dist_t snr14[] = {{96, 0.0368935620734}, {93, 0.0553403431101}, {99, 0.239808153477}, {98, 0.442722744881}, {108, 3.37576092972}, {97, 3.41265449179}, {102, 6.32724589559}, {103, 12.543811105}, {100, 13.3185759085}, {101, 14.7389780483}, {106, 41.8926397344}, {107, 69.9501936912}, {104, 81.0367090943}, {105, 100.0}};
lqi_dist_t snr17[] = {{99, 0.0569962952408}, {98, 0.071245369051}, {108, 24.5654032488}, {102, 25.2208606441}, {103, 27.0732402394}, {100, 27.2014819037}, {101, 27.6004559704}, {106, 47.976631519}, {107, 87.1900826446}, {104, 91.1655742377}, {105, 100.0}};
lqi_dist_t snr16[] = {{99, 0.0779271381259}, {98, 0.116890707189}, {108, 15.0983830119}, {102, 16.0335086694}, {103, 18.9362945646}, {100, 19.0726670563}, {101, 19.4038573933}, {106, 41.3987921294}, {107, 81.9793493084}, {104, 87.6680303916}, {105, 100.0}};
lqi_dist_t snr19[] = {{99, 0.0210039907582}, {108, 35.1816845201}, {102, 35.622768326}, {103, 37.0930476791}, {100, 37.1560596513}, {101, 37.3871035497}, {106, 53.8542323041}, {107, 88.615837009}, {104, 91.8504515858}, {105, 100.0}};
lqi_dist_t snr18[] = {{99, 0.0137080191912}, {98, 0.0274160383825}, {108, 30.4043865661}, {102, 31.1583276217}, {103, 32.7484578478}, {100, 32.8169979438}, {101, 32.9403701165}, {106, 50.6374228924}, {107, 88.2933516107}, {104, 91.8026045236}, {105, 100.0}};
lqi_dist_t snr31[] = {{108, 52.9411764706}, {106, 70.5882352941}, {107, 100.0}};
lqi_dist_t snr30[] = {{108, 55.9880239521}, {103, 56.4371257485}, {101, 56.5868263473}, {106, 69.6107784431}, {107, 94.4610778443}, {104, 96.2574850299}, {105, 100.0}};

snr_lqi_t allSnr[] = {{24, 8, snr24}, {25, 10, snr25}, {26, 8, snr26}, {27, 9, snr27}, {20, 10, snr20}, {21, 9, snr21}, {22, 9, snr22}, {23, 9, snr23}, {28, 8, snr28}, {29, 8, snr29}, {0, 25, snr0}, {3, 45, snr3}, {2, 42, snr2}, {5, 46, snr5}, {7, 45, snr7}, {6, 45, snr6}, {8, 34, snr8}, {11, 20, snr11}, {10, 26, snr10}, {13, 13, snr13}, {12, 16, snr12}, {15, 11, snr15}, {14, 14, snr14}, {17, 11, snr17}, {16, 11, snr16}, {19, 10, snr19}, {18, 11, snr18}, {31, 3, snr31}, {30, 7, snr30}};
uint8_t allSnr_len = 29;

#endif
